#ifndef _OPERATOR_H_
#define _OPERATOR_H_

#include<iostream>

using std::cout;
using std::endl;

class Time
{
private:
	int hour;
	int minute;
public:
	Time() :hour(0), minute(0) {}
	Time(int h, int m) :hour(h), minute(m) {}
	void AddMin(int m);
	void AddHr(int h);
	void Reset(int h, int m);
	Time operator+(const Time& t) const;
	void Show() const;
};

void Time::AddMin(int m)
{
	minute += m;
	hour += minute / 60;
	minute %= 60;
}

void Time::AddHr(int h)
{
	hour += h;
}

void Time::Reset(int h, int m)
{
	hour = h;
	minute = m;
}

Time Time::operator+(const Time& t) const
{
	Time sum;
	sum.minute = minute + t.minute;
	sum.hour = hour + t.hour;
	sum.minute %= 60;
	return sum;
}

void Time::Show() const
{
	cout << hour << "hours," << minute << "minutes";
}

#endif